package com.hxgz.controller;


import com.hxgz.commom.ServerResponse;
import com.hxgz.service.ICommonCustdrugsService;
import com.hxgz.service.ICommonJntdrugsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author wuke
 * @since 2021-04-22
 */
@RestController
@RequestMapping("/common-custdrugs")
@Api("清理规格")
public class CommonCustdrugsController {
    @Autowired
    ICommonCustdrugsService commonCustdrugsService;

    @Autowired
    ICommonJntdrugsService commonJntdrugsService;


    @GetMapping("clearCon")
    @ApiOperation("整理机构药品规格")
    public ServerResponse clear() {
        Boolean flag = commonCustdrugsService.clear();
        return flag ? ServerResponse.createBySuccessMessage("操作成功") : ServerResponse.createByErrorMessage("操作失败");
    }


    @GetMapping("clearCom")
    @ApiOperation("整理平台药品规格")
    public ServerResponse clearCom() {
        Boolean flag = commonJntdrugsService.clearCom();
        return flag ? ServerResponse.createBySuccessMessage("操作成功") : ServerResponse.createByErrorMessage("操作失败");
    }


}
